package engine.logic.loading.effect
{
	public class TEFactory
	{
		public function TEFactory()
		{
			regeditTE();
		}
		
		static private var _self:TEFactory;
		static public function getInstance():TEFactory
		{
			if(_self == null)
				_self = new TEFactory();
			
			return _self;
		}
		
		private var _cacheTEArr:Array = [];
		
		private function regeditTE():void
		{
			_cacheTEArr.push(new Fade());
//			_cacheTEArr.push(new VerticalBlinds());
//			_cacheTEArr.push(new Fade2());
//			_cacheTEArr.push(new HorizontalBlinds());
//			_cacheTEArr.push(new Divids());
//			_cacheTEArr.push(new Avulsion());
		}
		
		public function getTE(type:String=null,cache:Boolean=true):AbstractTransitionEffect
		{
			
			var randomIndex:uint = Math.floor(Math.random()*_cacheTEArr.length);

			return _cacheTEArr[randomIndex];
		}
	}
}